<template>
<div class="newsinfo-container">
<h3 class="title">行文不同</h3>
<p class="subtitle">
    <span>时间</span>
    <span>次</span>
</p>
<hr>
<div class="content"></div>

   <h1>{{newsinfo.title}}</h1>

    <h1>123456---{{docid}}</h1>

    <comment-box></comment-box>
</div>


    
</template>
<script>
// 导入评论子组件
import comment from "../pinlunzhizhujian/comment.vue"
    export default{
        data(){
            return{
                docid:this.$route.params.docid,
                newsinfo:[]
            }
        },
        created(){
            this.getnewsinfo()
        },
        methods:{
            getnewsinfo(){
                this.$http.get("https://www.apiopen.top/journalismApi").then(result=>{
                    console.log(result.data.data)
                    if(result.data.code===200){
                      this.newsinfo=result.data.data  
                    }
                })
            }
        },
        components:{
            'comment-box':comment
        }
    }
</script>
<style lang="scss" scoped>
.newsinfo-container{
    padding: 0 4px;
    .title{
        font-size: 16px;
        text-align: center;
        margin: 15px 0;
        color: red;
    }
    .subtitle{
        font-size: 12px;
        color: aqua;
        display: flex;
        justify-content: space-between;
    }
}
</style>

